import Vue from 'vue';
//配置路由
import VueRouter from 'vue-router'
Vue.use(VueRouter);
//1.创建组件
import Index from '@/views/index'
import Home from '@/views/home'
import Login from '@/views/login'
import NotFound from '@/views/404'
import UpdatePassword from '@/views/update-password'
import pay from '@/views/pay'
import register from '@/views/register'
import center from '@/views/center'
	import fangwuleixing from '@/views/modules/fangwuleixing/list'
	import discussfangwuxinxi from '@/views/modules/discussfangwuxinxi/list'
	import news from '@/views/modules/news/list'
	import aboutus from '@/views/modules/aboutus/list'
	import weixiuchuli from '@/views/modules/weixiuchuli/list'
	import zulindingdan from '@/views/modules/zulindingdan/list'
	import jiufenchuli from '@/views/modules/jiufenchuli/list'
	import shangchuanhetong from '@/views/modules/shangchuanhetong/list'
	import tousuxinxi from '@/views/modules/tousuxinxi/list'
	import fangwuxinxi from '@/views/modules/fangwuxinxi/list'
	import zuhu from '@/views/modules/zuhu/list'
	import weixiushenqing from '@/views/modules/weixiushenqing/list'
	import systemintro from '@/views/modules/systemintro/list'
	import hetongqianding from '@/views/modules/hetongqianding/list'
	import hetongjiufen from '@/views/modules/hetongjiufen/list'
	import yajinxinxi from '@/views/modules/yajinxinxi/list'
	import hetongxinxi from '@/views/modules/hetongxinxi/list'
	import shouzutixing from '@/views/modules/shouzutixing/list'
	import weixiufankui from '@/views/modules/weixiufankui/list'
	import fangdong from '@/views/modules/fangdong/list'
	import kanfangyuyue from '@/views/modules/kanfangyuyue/list'
	import zulintuiding from '@/views/modules/zulintuiding/list'
	import config from '@/views/modules/config/list'
	import newstype from '@/views/modules/newstype/list'


//2.配置路由   注意：名字
export const routes = [{
	path: '/',
	name: '系统首页',
	component: Index,
	children: [{
		// 这里不设置值，是把main作为默认页面
		path: '/',
		name: '系统首页',
		component: Home,
		meta: {icon:'', title:'center', affix: true}
	}, {
		path: '/updatePassword',
		name: '修改密码',
		component: UpdatePassword,
		meta: {icon:'', title:'updatePassword'}
	}, {
		path: '/pay',
		name: '支付',
		component: pay,
		meta: {icon:'', title:'pay'}
	}, {
		path: '/center',
		name: '个人信息',
		component: center,
		meta: {icon:'', title:'center'}
	}
	,{
		path: '/fangwuleixing',
		name: '房屋类型',
		component: fangwuleixing
	}
	,{
		path: '/discussfangwuxinxi',
		name: '房屋信息评论',
		component: discussfangwuxinxi
	}
	,{
		path: '/news',
		name: '公告信息',
		component: news
	}
	,{
		path: '/aboutus',
		name: '关于我们',
		component: aboutus
	}
	,{
		path: '/weixiuchuli',
		name: '维修处理',
		component: weixiuchuli
	}
	,{
		path: '/zulindingdan',
		name: '租赁订单',
		component: zulindingdan
	}
	,{
		path: '/jiufenchuli',
		name: '纠纷处理',
		component: jiufenchuli
	}
	,{
		path: '/shangchuanhetong',
		name: '上传合同',
		component: shangchuanhetong
	}
	,{
		path: '/tousuxinxi',
		name: '投诉信息',
		component: tousuxinxi
	}
	,{
		path: '/fangwuxinxi',
		name: '房屋信息',
		component: fangwuxinxi
	}
	,{
		path: '/zuhu',
		name: '租户',
		component: zuhu
	}
	,{
		path: '/weixiushenqing',
		name: '维修申请',
		component: weixiushenqing
	}
	,{
		path: '/systemintro',
		name: '系统简介',
		component: systemintro
	}
	,{
		path: '/hetongqianding',
		name: '合同签订',
		component: hetongqianding
	}
	,{
		path: '/hetongjiufen',
		name: '合同纠纷',
		component: hetongjiufen
	}
	,{
		path: '/yajinxinxi',
		name: '押金信息',
		component: yajinxinxi
	}
	,{
		path: '/hetongxinxi',
		name: '合同信息',
		component: hetongxinxi
	}
	,{
		path: '/shouzutixing',
		name: '收租提醒',
		component: shouzutixing
	}
	,{
		path: '/weixiufankui',
		name: '维修反馈',
		component: weixiufankui
	}
	,{
		path: '/fangdong',
		name: '房东',
		component: fangdong
	}
	,{
		path: '/kanfangyuyue',
		name: '看房预约',
		component: kanfangyuyue
	}
	,{
		path: '/zulintuiding',
		name: '租赁退订',
		component: zulintuiding
	}
	,{
		path: '/config',
		name: '轮播图管理',
		component: config
	}
	,{
		path: '/newstype',
		name: '公告信息分类',
		component: newstype
	}
	]
	},
	{
		path: '/login',
		name: 'login',
		component: Login,
		meta: {icon:'', title:'login'}
	},
	{
		path: '/register',
		name: 'register',
		component: register,
		meta: {icon:'', title:'register'}
	},
	{
		path: '*',
		component: NotFound
	}
]
//3.实例化VueRouter  注意：名字
const router = new VueRouter({
	mode: 'hash',
	/*hash模式改为history*/
	routes // （缩写）相当于 routes: routes
})
const originalPush = VueRouter.prototype.push
//修改原型对象中的push方法
VueRouter.prototype.push = function push(location) {
	return originalPush.call(this, location).catch(err => err)
}
export default router;
